import React from 'react';
import { Router, Route, Switch, Redirect } from 'react-router-dom';
import BrowserHistory from '@/util/history';
import Layout from '@/view/layout/layout';
import Login from '@/view/pages/login/login';


export default class Page extends React.Component {
	render() {
		return (
			<Router history={BrowserHistory}>
				<Switch>
					<Route path="/app" component={Layout} />
					<Route path="/login" component={Login} />
					<Route path="/404" render={() => <h1>404 Page not found</h1>} />
					<Route path="/" render={() => <Redirect to="/app" />} />
					<Route render={() => <h1>404 Page not found</h1>} />
				</Switch>
			</Router>
		);
	}
}